package cn.longge.service.impl;

import cn.longge.entity.SysOffice;
import cn.longge.mapper.SysOfficeMapper;
import cn.longge.service.ISysOfficeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class SysOfficeServiceImpl extends BaseServiceImpl<SysOffice> implements ISysOfficeService {
    @Autowired
    private SysOfficeMapper officeMapper;
    @Override
    public Map<String,List<SysOffice>> selectByRid(long rid) {
        List<SysOffice> allOffice = officeMapper.selectByRid(rid);
        SysOffice office = new SysOffice();
        office.setDelFlag("0");
        List<SysOffice> offices = officeMapper.select(office);
        Map<String,List<SysOffice>> map = new HashMap<String,List<SysOffice>>();
        map.put("all",offices);
        map.put("office",allOffice);
        return map;
    }

    @Override
    public SysOffice selectByPrimaryKey(Object o) {
        String s = null;
        s.length();
        return super.selectByPrimaryKey(o);
    }
}
